<?php
/* @var $this InvoiceAddressController */
/* @var $form CActiveForm */
/* @var $user_id */
/* @var $private */
/* @var $company */
?>

<?php
$this->widget('bootstrap.widgets.TbTabs', array(
    'type'=>'tabs', // 'tabs' or 'pills'
    'tabs'=>array(
        array('label'=>'Übersicht', 'url'=>$this->createUrl('user/admin'), 'active'=>false),
        array('label'=>'|'),
        array('label'=>'Stammdaten', 'url'=>$this->createUrl('user/update', array('id'=>$user_id)), 'active'=>false),  
        array('label'=>'Rechnungsadressen', 'url'=>$this->createUrl('invoiceAddress/update', array('user_id'=>$user_id)), 'active'=>true), 
        array('label'=>'Kurse', 'url'=>$this->createUrl('user/getCourseForUser', array('id'=>$user_id)), 'active'=>false),
        array('label'=>'|'),
        array('label'=>'NEU', 'url'=>$this->createUrl('user/create'), 'active'=>false),
    ),
));
?>

<?php     
    $private = $this->getModelByTypeForUser($user_id, 'Privat');
    $company = $this->getModelByTypeForUser($user_id, 'Geschäftlich');
?>



<div class="form">


    <?php echo CHtml::beginForm(); ?>
    <h1>Privat:</h1>

	<div class="row">
		<?php echo $form->labelEx($private,'address'); ?>
		<?php echo $form->textField($private,'address'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
    	<div class="row">
		<?php echo $form->labelEx($private,'postcode'); ?>
		<?php echo $form->textField($private,'postcode'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
    	<div class="row">
		<?php echo $form->labelEx($private,'place'); ?>
		<?php echo $form->textField($private,'place'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
    	<div class="row">
		<?php echo $form->labelEx($private,'tel'); ?>
		<?php echo $form->textField($private,'tel'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
        <div class="row">
		<?php echo $form->labelEx($private,'email'); ?>
		<?php echo $form->textField($private,'email'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
    
    <h1>Geschäftlich:</h1>
	<div class="row">
		<?php echo $form->labelEx($company,'address'); ?>
		<?php echo $form->textField($company,'address'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
    	<div class="row">
		<?php echo $form->labelEx($company,'postcode'); ?>
		<?php echo $form->textField($company,'postcode'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
    	<div class="row">
		<?php echo $form->labelEx($company,'place'); ?>
		<?php echo $form->textField($company,'place'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
    	<div class="row">
		<?php echo $form->labelEx($company,'tel'); ?>
		<?php echo $form->textField($company,'tel'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
        <div class="row">
		<?php echo $form->labelEx($company,'email'); ?>
		<?php echo $form->textField($company,'email'); ?>
		<?php // echo $form->error($private,'address'); ?>
	</div>
    
	<div class="row buttons">
		<?php echo CHtml::submitButton($private->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php echo CHtml::endForm(); ?>

</div><!-- form -->